import { Tag } from "@/api/service/priceTag/types";

import { SelectOption } from "@arco-design/web-vue";
import { TransferItem } from "@arco-design/web-vue/es/transfer/interface";

import { columns } from "./columns";

const t = translate("公共模块");

export const showForm = ref(false);
const formData: Tag = {
  tagId: "",
  tagCode: "",
  goodsId: "",
  templateId: "",
  mac: null,
  resolutionId: "",
  stationId: "",
  tagColor: "",
  bindMode: "0",
  bindingTime: "",
  lastUpdateTime: "",
  lastOnlineTime: "",
  status: "",
  rssi: 0,
  refreshTimes: 0,
  imgSrc: "",
  soc: 0,
  centigrade: 0,
  power: 0,
  rate: 0,
  fwVersion: "",
  type: "",
  deptId: "",
  stationName: "",
  stationNum: "",
  goodsName: "",
  templateName: "",
  resolutionDesc: "",
  resolutionWidth: 0,
  resolutionHeight: 0,
  vlast: 0,
  location: "",
  alias: "a",
  goodsList: []
};
export const form = ref(formData);
export const resetForm = () => {
  form.value = formData;
};
export const downloadArray = [
  {
    text: t.value?.["批量新增价签"],
    type: 0
  },
  {
    text: t.value?.["批量绑定模板"],
    type: 1
  }
];
/* 0：批量新增标签&上传 */
/* 1：批量绑定标签&上传 */
export const uploadArray = [
  {
    text: t.value?.["批量新增"],
    type: 0
  },
  {
    text: t.value?.["批量绑定"],
    type: 1
  }
];
export const transferColumns = computed((): TransferItem[] => {
  return columns.map((e: any) => {
    return {
      label: t.value?.[e.title],
      value: e.dataIndex,
      disabled: false
    };
  });
});

export const selectedKeys = ref<string[]>([]);
export const tableData = ref<Tag[]>([]);
export const stationList = ref<Array<SelectOption>>([]);
